//
//    Copyright (C) 2012  OinkStudio
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.

package database;

/*Clase dedicada a guardar todo lo relacionado con una columna de una tabla*/
public class Column{

	//Aunque podrian ser String, usaremos Object y ya se haran los casts 
	//necesarios se hace asi para poder hacer el checkBox de la tabla Delete
	private Object name;
	private Object data;
	private Object dataType;
	// Esta variable la utilizaremos para indicar que la columna es un
	// atributo de la tabla
	public static String TABLE_ATTRIB = "TABLE_ATTRIB";
	
	//Con esta variable indicamos que se trata de la columna delete
	public static String DELETE_COLUMN = "DELETE_COLUMN";
	

	public Column(Object name, Object data, Object dataType) {
		this.name = name;
		this.data = data;
		this.dataType = dataType;		
	}

	public Object getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Object getData() {
		if (data != null && data.equals(TABLE_ATTRIB)) {
			return "";
		}
		return data;
	}

	public void setData(String data) {
		this.data = data;
	}

	public Object getDataType() {
		return dataType;
	}

	public void setDataType(String dataType) {
		this.dataType = dataType;
	}
}
